<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xmlns:aop="http://www.springframework.org/schema/aop"
		xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans-2.0.xsd
				http://www.springframework.org/schema/aop https://www.springframework.org/schema/aop/spring-aop-2.0.xsd">

	<aop:config>
		<aop:aspect id="beanNameMatchingTest" ref="counterAspect">
			<aop:pointcut id="bean1Operation" expression="execution(* set*(..)) and bean(myBean) and !bean(foo)"/>
			<aop:before pointcut-ref="bean1Operation" method="increment()"/>

			<aop:pointcut id="nestedBeanOperation" expression="execution(* getCompany(..)) and bean(testBean*)"/>
			<aop:before pointcut-ref="nestedBeanOperation" method="increment()"/>

			<aop:pointcut id="factoryBean1Operation" expression="bean(testFactoryBean1)"/>
			<aop:before pointcut-ref="factoryBean1Operation" method="increment()"/>

			<aop:pointcut id="factoryBean2Operation" expression="bean(&amp;testFactoryBean2)"/>
			<aop:before pointcut-ref="factoryBean2Operation" method="increment()"/>
		</aop:aspect>
	</aop:config>

	<bean id="tb1" name="testBean1" class="org.springframework.beans.testfixture.beans.TestBean">
		<qualifier value="myBean"/>
	</bean>

	<bean id="tb2" name="testBean2" class="org.springframework.beans.testfixture.beans.TestBean"/>

	<bean id="testBeanContainingNestedBean" class="org.springframework.beans.testfixture.beans.TestBean">
		<property name="doctor">
			<bean class="org.springframework.beans.testfixture.beans.NestedTestBean"/>
		</property>
	</bean>

	<bean id="testFactoryBean1" class="org.springframework.beans.factory.config.MapFactoryBean">
		<property name="sourceMap">
			<map>
				<entry key="myKey" value="myValue"/>
			</map>
		</property>
	</bean>

	<bean id="testFactoryBean2" class="org.springframework.beans.factory.config.MapFactoryBean">
		<property name="sourceMap">
			<map>
				<entry key="myKey" value="myValue"/>
			</map>
		</property>
	</bean>

	<bean id="counterAspect" class="org.springframework.aop.aspectj.Counter"/>

	<aop:config>
		<aop:advisor pointcut="bean(*This) and !bean(dont*)" advice-ref="testInterceptor"/>
	</aop:config>

	<bean id="interceptThis" class="org.springframework.beans.testfixture.beans.TestBean"/>

	<bean id="dontInterceptThis" class="org.springframework.beans.testfixture.beans.TestBean"/>

	<bean id="testInterceptor" class="org.springframework.aop.aspectj.BeanNamePointcutTests$TestInterceptor"/>

</beans>
